#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QDir>
#include <QMessageBox>
#include <QFileDialog>
#define MS "MSVC2019_64"
#define MI "MinGW_64"

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
    const QStringList compliers = {MS, MI};
    const QStringList modes = {"debug", "release"};
    const QString Template = "win32 {\n\
\tBasePath = $$PWD/lib\n\
\tMSVCKit = MSVC2019_64\n\
\tMinGWKit = MinGW_64\n\n\
\tcontains(QMAKE_COMPILER, msvc) {\n\
\t\t# MSVC编译器\n\
\t\tisDebugBuild: LIBS += -L$${BasePath}/$${MSVCKit}/debug/ -l%1d\n\
\t\telse:         LIBS += -L$${BasePath}/$${MSVCKit}/release/ -l%1\n\
\t}\n\
\telse {\n\
\t\t# 其他编译器，默认是MinGW\n\
\t\tisDebugBuild: LIBS += -L$${BasePath}/$${MinGWKit}/debug/ -l%1\n\
\t\telse:         LIBS += -L$${BasePath}/$${MinGWKit}/release/ -l%1\n\
\t}\n\
}\n\n\
INCLUDEPATH += $$PWD/include\n\
DEPENDPATH += $$PWD/include\n";
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    bool collectBuildOutputs(const QString& basePath,
                             const QString& designerPath,
                             const QString& pluginName,
                             const QString& pluginPackPath
                             );
    bool processPlugin(const QString& basePath, const QString& designerPath,
                       const QString& pluginPackPath, const QString& pluginName);
    QString path();
    bool copy(const QString& file, const QString& copyFile);
    void tip(const QString& context);
private slots:
    void on_btn_basePath_clicked();

    void on_btn_designerPath_clicked();

    void on_btn_pluginName_clicked();

    void on_btn_pluginPackPath_clicked();

    void on_btn_packing_clicked();

private:
    Ui::MainWindow *ui;
    bool needRestartQt = false;
};
#endif // MAINWINDOW_H



